<template>
    <div>
        <el-table
            :data="tableData"
            :cell-style="{padding: '0'}"
            :row-style="{height: '60px'}"
            fit
            border
            style="width: 100%;margin-bottom: 20px;">
            <el-table-column
              header-align="center"
              align="center"
              label="总订单数">
              <template slot-scope="scope">
                  <el-badge :value="scope.row.total" type="primary">
                      <el-button size="mini">总订单数</el-button>
                  </el-badge>
              </template>
            </el-table-column>
            <el-table-column
              header-align="center"
              align="center"
              label="待分配订单数">
              <template slot-scope="scope">
                  <el-badge :value="scope.row.dealTotal">
                      <el-button size="mini">待分配数</el-button>
                  </el-badge>
              </template>
            </el-table-column>
            <el-table-column
              header-align="center"
              align="center"
              label="已分配订单数">
              <template slot-scope="scope">
                  <el-badge :value="scope.row.assignedTotal" type="warning">
                      <el-button size="mini">已分配数</el-button>
                  </el-badge>
              </template>
            </el-table-column>
            <el-table-column
              header-align="center"
              align="center"
              label="配送中订单数">
              <template slot-scope="scope">
                  <el-badge :value="scope.row.shippingTotal" type="primary">
                      <el-button size="mini">配送中数</el-button>
                  </el-badge>
              </template>
            </el-table-column>
            <el-table-column
              header-align="center"
              align="center"
              label="已完成订单数">
              <template slot-scope="scope">
                  <el-badge :value="scope.row.finishTotal" type="success">
                      <el-button size="mini">已完成数</el-button>
                  </el-badge>
              </template>
            </el-table-column>
          </el-table>
    </div>
</template>

<script>
    import request from '../../../utils/request.js'
    export default {
        data() {
          return {
            tableData: []
          }
        },
        methods:{
            getCount() {
                request.get("/order/getCount").then(res=>{
                    this.tableData.push(res.data);                           
                })
            }
        },
        mounted() {
            this.getCount();
        }
      }
</script>

<style scoped>
      /deep/ .el-table .cell{overflow: unset}
</style>
